package com.ytjj.qmyx.supplychain.api.controller;


import com.ytjj.qmyx.supplychain.common.api.CommonResult;
import com.ytjj.qmyx.supplychain.common.model.request.DelayedRegionRequest;
import com.ytjj.qmyx.supplychain.service.DelayedRegionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 
 */
@Slf4j
@RestController
@RequestMapping("/delayedRegion")
public class DelayedRegionController {

    @Autowired
    private DelayedRegionService delayedRegionService;

    /**
     * 列表
     * @param pageNum 页码
     * @param pageSize 数量
     * @return
     */
    @GetMapping("/list")
    public CommonResult list(@RequestParam Integer pageNum,@RequestParam Integer pageSize){
        return delayedRegionService.list(pageNum,pageSize);
    }

    /**
     * 修改地址
     * @param request
     * @return
     */
    @PostMapping("/update")
    public CommonResult update(@RequestBody DelayedRegionRequest request){
        return delayedRegionService.update(request);
    }

    /**
     * 查询id为1的
     * @return
     */
    @GetMapping("/selectIdBy1")
    public String selectIdBy1(){
        return delayedRegionService.selectIdBy1();
    }
}
